<?php

// uncomment the following to define a path alias
// Yii::setPathOfAlias('local','path/to/local-folder');

// This is the main Web application configuration. Any writable
// CWebApplication properties can be configured here.

require_once( dirname(__FILE__) . '/../helpers/common_helper.php');
require_once( dirname(__FILE__) . '/../helpers/menu_helper.php');

return array(
	'basePath'=>dirname(__FILE__).DIRECTORY_SEPARATOR.'..',
	'name'=>'Сайт - визитка',

	'sourceLanguage' => 'en',
	'language' => 'en',
	
	'theme' => 'blueribbon',

	// preloading 'log' component
	'preload'=>array('log'),

	// autoloading model and component classes
	'import'=>require(dirname(__FILE__) . '/include/import.php'),
	'modules'=>CMap::mergeArray(
		array(
			'gii' => array(
				'class'=>'system.gii.GiiModule',
				'password'=>'123456',
				'ipFilters' => array(
					'127.0.0.1',
					'::1'
				)
			),
			'install'
		),
		require(dirname(__FILE__) . '/include/modules.php')
	),
	
	'controllerMap' => array( 'photo_upload' => 'application.modules.editor.RedactorController', ),
	// application components
	'components'=>CMap::mergeArray(
		array(
			'mailer'=>array(
				'class'=>'ext.swiftMailer.SwiftMailer',
				
				'mailer'=>'sendmail',
				'sendmailCommand'=>'/usr/sbin/sendmail -t -i',
				
			),
			'settings'=>array(
				'class'             => 'CSettings',
				'cacheComponentId'  => 'cache',
				'cacheId'           => 'global_website_settings',
				'cacheTime'         => 84000,
				'tableName'			=> '{{settings}}',
				'dbComponentId'     => 'db',
				'createTable'       => true,
				'dbEngine'			=> 'MyISAM',
			),
			'ftp'=>require(dirname(__FILE__) . '/include/ftp.php'),
			'cache'=>array(
				'class'=>'system.caching.CFileCache',
			),
			'user'=>array(
				// enable cookie-based authentication
				'allowAutoLogin'=>true,
			),
			// uncomment the following to use a MySQL database
			'db'=>require(dirname(__FILE__) . '/include/db.php'),
			'errorHandler'=>array(
				// use 'site/error' action to display errors
				'errorAction'=>'site/error',
			),
			'log'=>array(
				'class'=>'CLogRouter',
				'routes'=>array(
					array(
						'class'=>'CFileLogRoute',
						'levels'=>'error, warning',
					),
					// uncomment the following to show log messages on web pages
					/*
					array(
						'class'=>'CWebLogRoute',
					),
					*/
				),
			),
		),
		require(dirname(__FILE__) . '/include/components.php')
	),

	// application-level parameters that can be accessed
	// using Yii::app()->params['paramName']
	'params'=> CMap::mergeArray(
		array(
			// this is used in contact page
			'adminTheme'=>'admin',
			'adminPaginationPageSize'=>10,

			'registrationAdminApproveRequired'=>false,
			
			'cachePages'=>false,
			'cacheEnabled'=>true,
			
			'dateFormat'=>'d.m.Y H:i'
		),
		require(dirname(__FILE__) . '/include/params.php')
	)
);